/*
 * @Author: xiaosihan 
 * @Date: 2024-06-20 21:46:31 
 * @Last Modified by: xiaosihan
 * @Last Modified time: 2024-06-21 12:34:48
 */


import { observable, configure } from "mobx";

configure({ enforceActions: "never" });

//公共状态管理
const homeStore = observable({


    //爆炸的进度
    blastProgress: 0,
    setBlastProgress(blastProgress: number) {
        this.blastProgress = blastProgress;
    },

    //当前模型
    currentModal: "./柴油发动机.glb",
    setCurrentModal(currentModal: string) {
        this.currentModal = currentModal;

        //切换模型之后选中id要置空
        this.setActiveId("");
    },

    //隐藏未选中
    hideNotActive: true,
    setHideNotActive(hideNotActive: boolean) {
        this.hideNotActive = hideNotActive;
    },

    //当前选中的模型对象id
    activeId: "",
    setActiveId(activeId: string) {
        this.activeId = activeId;
    },

    // 当前选中的模型的名字
    activeName: "",
    setActiveName(activeName: string) {
        this.activeName = activeName;
    },

    //当前选中的模型的尺寸
    activeSize: { x: 0, y: 0, z: 0 },
    setActiveSize(activeSize: { x: number, y: number, z: number }) {
        this.activeSize = activeSize;
    },

    //当前选中的模型位置
    activePosition: { x: 0, y: 0, z: 0 },
    setActivePosition(activePosition: { x: number, y: number, z: number }) {
        this.activePosition = activePosition;
    }

});

export default homeStore;